package com.example.designmode.demos.responsibilityChain.handler;

import com.example.designmode.demos.responsibilityChain.HandleRequest;
import com.example.designmode.demos.responsibilityChain.LeaveRequest;

public class GroupLeader extends HandleRequest {//组长类
    public GroupLeader(HandleRequest handleRequest, int maxDay) {
        super(handleRequest, maxDay);
    }
 
    @Override
    public void handleLeaveRequest(LeaveRequest leaveRequest) {
        if(leaveRequest.leaveDays<=this.maxDay){ //在自己处理范围内则自己处理
            System.out.println("组长来处理");
        }
        else { //不在自己处理范围内则交给领导处理
            System.out.println("组长处理不了，交给组长的上级");
            this.nextPerson.handleLeaveRequest(leaveRequest);
        }
    }
 
}